{% extends "base.html" %}
{% block content %}
<h3>{{order.restaurant.name}},{{order.customer.name}}</h3>
{{order.get_count}}份,共计{{order.get_total}}元
<ul>
{% for item in order.get_items %}
	<li>{{item.item.name}},{{item.item.price}},{{item.count}},{{item.get_total}},{{item.item.description}} </li>
{% endfor %}
</ul>
<script type="text/javascript">
	function change_address()
	{
		obj = document.getElementById("address_div");
		if(obj.style.cssText == "")
			obj.style.cssText = "display:none";
		else
			obj.style.cssText = "";
	}
</script>
<form id="order_form" method="post" action="/order/{{order.id}}/">
	{% csrf_token %}
	{% if customer.phone %}
		<label>您的联系电话：</label>
		<input id="phone" type="text" value="{{customer.phone}}">
		</br>
	{% else %}
		<label>您尚未填写联系电话，请输入：</label>
		<input id="code" type="text"/><a href="#">点此获取验证码</a>
		</br>
		<label>请输入您手机收到的验证码：</label>
		<input id="phone" type="text">
		</br>
	{% endif %}
	
	{% if customer.get_address %}
		<label>您的配餐地址：<a id="your_address">{{customer.get_address}}</a></label>
		</br>
		<a onclick="change_address();">修改配餐地址</a>
		<div id="address_div" style="display:none">
			{% include "address.html" %}
			<input type="hidden" id="is_address_changed" value="no">
		</div>
	{% else %}
		<label>您尚未填写配餐地址，请输入：</label>{% include "address.html" %}
		
	{% endif %}
	</br>
	<input type="submit" value="确定">
	
</form>
{% endblock %}